package dbops;

import dbops.COLUMN.DATA_TYPE;

/**
 * Description   : Functional Test Script
 * @author angel.tsvetkov
 */

/**
 * CELL is a class which purpose is to represent a DB cell with all possible
 * properties which a cell can have: 
 * - value - the value of the cell 
 * - type - DATA_TYPE representation of the cell, which is used in building a query
 * statement for example
 * -column - the column in which the cell belong
 */
public class CELL {
	private DATA_TYPE type;

	private String value;

	public static CELL create(DATA_TYPE type, String value)
	{
		return new CELL(type, value);
	}
	
	public static CELL create(String value, COLUMN column)
	{
		return new CELL(value, column);
	}
	
	public CELL(DATA_TYPE type, String value) {
		this.type = type;
		this.value = value;
	}

	public CELL(String value, COLUMN column) {
		this.value = value;
		this.column = column;
		this.type = this.column.Type();
	}

	private COLUMN column = null;


	public DATA_TYPE getType() {
		return type;
	}

	public String getValue() {
		return value;
	}

	public COLUMN getColumn() {
		return column;
	}
}
